
/*
 * ProfileAlgo.java
 *
 * Created on 08-May-2010, 01:41:00
 */

package camp.junk;

import camp.bigoldataset.*;
import campskeleton.Profile;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import utils.ListDownLayout;
import utils.ui.WindowManager;

/**
 *
 * @author twak
 */
public class SaturdayEditor extends javax.swing.JFrame {

    Algo algo;
    Map<String, Profile> mapping;

    /** Creates new form ProfileAlgo */
    public SaturdayEditor() {
        initComponents();
        WindowManager.register(this);
    }

    public SaturdayEditor( Map<String, Profile> mapping, List<Profile> profiles )
    {
        initComponents();
        elementList.setLayout( new ListDownLayout() );
        List<String> keys = new ArrayList<String> ( mapping.keySet() );
        Collections.sort( keys );
        for ( String s :  keys )
            elementList.add( new AlgoElement( s, profiles, mapping, mapping.get( s ) ) );
        this.mapping = mapping;
        setSize( 600, 600 );
        setVisible( true );
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        elementList = new javax.swing.JPanel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        javax.swing.GroupLayout elementListLayout = new javax.swing.GroupLayout(elementList);
        elementList.setLayout(elementListLayout);
        elementListLayout.setHorizontalGroup(
            elementListLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 365, Short.MAX_VALUE)
        );
        elementListLayout.setVerticalGroup(
            elementListLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 276, Short.MAX_VALUE)
        );

        jScrollPane1.setViewportView(elementList);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 367, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new SaturdayEditor().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel elementList;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables

}
